package com.gree.changying.server.utils;

import java.util.Comparator;

/**
 * 
 * @author youdelu 2016-06-6 11:22:45
 * 拼音排序处理
 * 用法 Arrays.sort(String[], new PinyinComparator());
 */
public class PinyinComparator implements Comparator {

	@Override
	public int compare(Object o1, Object o2) {
		 String str1 = GenerateUtil.getAllFirstLetter((String) o1);
	     String str2 = GenerateUtil.getAllFirstLetter((String) o2);
	     return str1.compareTo(str2);
	}

	@Override
	public boolean equals(Object o) {
		return super.equals(o);
	}

}
